<template>
  <div class="form form-inline">
    <input type="text" class="form-control input-sm" placeholder="用户ID" v-model="form.customerId">
    <button class="btn btn-sm btn-primary" @click="searchList">搜索</button>
    <vue-answer :show-answer.sync="showAnswer" :it="it"></vue-answer>
  </div>
  <table v-show="list && list.length > 0" class="table table-bordered table-hover">
    <caption>用户提问日志</caption>
    <thead>
      <tr>
        <th>日志ID</th>
        <th>用户ID</th>
        <th>提问关键字</th>
        <th>点击的问题ID</th>
        <th>返回结果数</th>
        <th>问题类别</th>
        <th>提问时间</th>
        <th>回复人</th>
        <th>回复内容</th>
        <th>回复时间</th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="it in list">
        <td>{{it.id}}</td>
        <td>{{it.customerId}}</td>
        <td>{{it.keyword}}</td>
        <td>{{it.qid}}</td>
        <td>{{it.resultCount}}</td>
        <td class="col-nowrap">{{it.type | AIQuestionType}}</td>
        <td>{{it.createTime | toDate}}</td>
        <td>{{it.replyStaff}}</td>
        <td class="content">
          <template v-if="+it.questionType ===-1">
           {{it.answerContent}}
          </template>
        </td>
        <td>{{it.endTime | toDate}}</td>
        <td>
          <button class="btn btn-sm btn-primary" @click="showAnswerNoResult(it)">选择问题库id</button>
          <button class="btn btn-sm btn-primary" @click="showAnswerManual(it)">手动回复内容</button>
        </td>
      </tr>
    </tbody>
  </table>
  <vue-pages :pages.sync="pages" :get-list="getList"></vue-pages>
  <vue-answer :show-answer.sync="showAnswer" :it.sync="it"></vue-answer>
  <vue-manual :show-manual.sync="showManual" :it.sync="it"></vue-manual>
</template>
<style src="./question-log.css" scoped></style>
<script src="./question-log.js"></script>